﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CodingWiki_Model.Models.FluentModels
{
    //    <Nullable>enable</Nullable> 去掉就不会 提示 设置 xxx 可以为空
    public class Fluent_Book
    {
        //[Key] //必须有主键 或者命名为ID 或 BookId  className+Id
        public int BookId { get; set; }
        public string Title { get; set; }

        public string ISBN { get; set; }
        public decimal Price { get; set; }

        public string PriceRange { get; set; }

        public Fluent_BookDetail BookDetail { get; set; }
        public int Publisher_Id { get; set; }

        ////外键链接Publisher表 1对多
        //[ForeignKey("Publisher")]
        //public int Publisher_Id { get; set; }
        public Fluent_Publisher Publisher { get; set; }

        ////多对多 会创建一个中间表 
        public List<Fluent_BookAuthorMap> BookAuthorMap { get; set; }
    }
}
